# Hisilicon Hi35xx sample Makefile

include ../Makefile.param
#ifeq ($(SAMPLE_PARAM_FILE), )
#     SAMPLE_PARAM_FILE:=../Makefile.param
#     include $(SAMPLE_PARAM_FILE)
#endif

# lib name define
NAME = mpp_master
TARGET = lib$(NAME).a

.PHONY : clean all

ifeq ($(BUILD_TYPE), release)
    CFLAGS		+= -DNDEBUG
    CFLAGS		+= -O2
else
    CFLAGS		+= -g
endif

CFLAGS +=  -static -pthread

#ar flag
ARFLAGS = -r

HEADERS = $(wildcard *.h)

all: $(TARGET)

objects := $(patsubst %.c,%.o,$(wildcard *.c))

# target source
MPI_LIBS := $(REL_LIB)/libmpi.a
MPI_LIBS += $(REL_LIB)/libhdmi.a

$(TARGET) : $(objects)
	$(AR) $(ARFLAGS) $@  $^ $(MPI_LIBS) $(AUDIO_LIBA) $(JPEGD_LIBA)
	
$(objects): %.o: %.c $(HEADERS)
	$(CC) -c $(CFLAGS) $(LDFLAGS) $< -o $@

clean:
	@rm -f $(TARGET)
	@rm -f $(OBJ)
	@rm -f $(objects)

cleanstream:
#	@rm -f *.h264
#	@rm -f *.jpg
#	@rm -f *.mjp
#	@rm -f *.mp4
